﻿<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="resources/images/favicon.png" type="image/x-icon"> 
<link rel="shortcut icon" href="resources/images/favicon.png" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="resources/zui/css/zui.min.css">
<script type="text/javascript" charset="UTF-8" src="resources/js/framejs/jquery-1.10.2.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="resources/zui/js/zui.min.js"></script>
<script type="text/javascript" charset="UTF-8">
	var serverURL="<%=basePath%>"; 
	function warnInput($obj){				
		$obj.tooltip("show");
	}
	function clearWarn($obj){
		$obj.tooltip("hide");
	}
	$(function(){
		//警告和清除警告
		$("[data-toggle='tooltip']").tooltip({trigger:"manual"}).focus(function(){
			clearWarn($(this));
		});
		//加载中
		function showLoading(){
			$("#mask").css("height",$(document).height()).show();
			$("#loading_img").css("top",$(document).scrollTop()+$(window).height()/2).show();
		}
		function hideLoading(){
			$("#mask").hide();
			$("#loading_img").hide();
		}
		$("html body").append("<div id='mask' class='mask'></div>"+
							  "<div id='loading_img' class='loading_img'></div>");
		//全局的ajax事件和效果
		$(document).ajaxSuccess(function(evt, xhr, settings){
			if($.parseJSON(xhr.responseText).code==-1){
				if(confirm("由于您长时间未进行任何操作，请重新登录")){
					window.parent.location.href=serverURL+"login.jsp";
				}
			}
		});
		$(document).ajaxStart(function(){
			showLoading();
		});
		$(document).ajaxComplete(function(){
			hideLoading();
		});
// 		$(document).ajaxError(function(event,request, settings){
// 			alert("数据请求失败，请重试");
// 		});
	});
</script>
<!--[if lt IE 8]>
     <div class="alert alert-danger">您正在使用 <strong>过时的</strong> 浏览器. 是时候 <a href="http://browsehappy.com/">更换一个更好的浏览器</a> 来提升用户体验.</div>
<![endif]-->
<!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->